The Microsoft Windows® (hereinafter “Windows”) kernel and Windows® programs have the ability to protect certain byte ranges in files from being read by other processes. This is done by opening a file and then issuing a lock command on the byte range this process would like to protect.
As long as this process holds the file open, other processes are subject to the locks held by this process. Attempts to read such a file by other processes will result in Windows® “lock violations”, and the data in the specified byte ranges in the file cannot be read.
Need to Access Locked Files
However, the data in these files can be extremely important to many applications, especially backup applications. For example, it is important for backup applications to be able to read and backup every file on a machine. In addition, some of these protected files are files containing Windows® registry information and are therefore necessary for the correct operation of a restored backup image.
Prior Art Systems
Currently, backup applications take one of two approaches to get around this problem.
Sector-Wise Copy
In the first prior art approach, as shown in prior art FIG. 1A, an application would (1) do a sector-wise copy of data on the drive, as step 112, and (2) generate an entire image of the disk, as step 114. Unfortunately, this method produces a monolithic copy of the drive. In addition, this technique produces a disk image in which it is difficult to locate the sectors of an individual file. This makes a “single file restore” from this image very difficult.
The second prior art approach that applications use, as shown in prior art FIG. 1B, is to (1) shutdown the machine, as step 122, and (2) bring it up in a “preboot” environment, as step 124, where the (3) file copy can be performed, as step 126. The machine is either rebooted again, or finishes booting to Windows®. This method is poor because it requires a reboot to be able to copy these files. In addition, a backup while the machine is running is impossible.
Therefore, a method and system of accessing at least one target file in a computer system with an operating system with file locking implemented with byte-range locking is needed.